package aop.service.impl;

import aop.exception.UsernameExistsException;
import aop.service.UserService;
import org.springframework.stereotype.Service;

/**
 * Author：汤小洋
 * Date：2023-08-11 13:41
 * Description：<描述>
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public void login(String username, String password) {
        System.out.println("UserServiceImpl.login.............."+username+","+password);
    }

    @Override
    public String logout() {
        System.out.println("UserServiceImpl.logout...................");
        return "byebye";
    }

    @Override
    public void resigter(String username, String password) {
        if ("admin".equals(username)){
            throw new UsernameExistsException("用户名已存在！！！");
        }
        System.out.println("UserServiceImpl.resigter.............."+username+","+password);
    }


}
